package com.android.gufengmall.adapter;

import android.view.LayoutInflater;
import android.view.ViewGroup;

import com.android.gufengmall.R;
import com.android.gufengmall.bean.CarouselBean;
import com.youth.banner.adapter.BannerAdapter;

import java.util.List;

public class CarouselTitleAdapter extends BannerAdapter<CarouselBean, CarouselTitleHolder> {

    public CarouselTitleAdapter(List<CarouselBean> mDatas) {
        super(mDatas);
    }

    @Override
    public CarouselTitleHolder onCreateHolder(ViewGroup parent, int viewType) {
        return new CarouselTitleHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.carousel_image_title, parent, false));
    }

    @Override
    public void onBindView(CarouselTitleHolder holder, CarouselBean data, int position, int size) {
        holder.imageView.setImageResource(data.imageRes);
        holder.title.setText(data.title);
    }

}
